<template>
  <div>
    <p class="popup-text">请选择不通过理由<br />
      <select v-model="selectIndex" class="popup-select" >
        <option v-for="item in selectOptions" :value="item.id" >{{item.name}}</option>
      </select>
      <!-- <input type="text" v-model="popupInput" placeholder="不通过补充说明" class="popup-input" > -->
    </p>
  </div>
</template>
<script>
  import { bus } from 'bus.js'
  export default {
    data () {
      return {
        selectIndex: 1,
        selectOptions: [
          {name: '事故车', id: 1},
          {name: '泡水车', id: 2},
          {name: '火烧车', id: 3}
        ],
        popupInput: ''
      }
    },
    watch: {
      'selectIndex' () {
        bus.$emit('globalPopupChange', [this.selectOptions[(this.selectIndex-1)].name, this.popupInput])
      }
    },
    created () {
      bus.$emit('globalPopupChange', [this.selectOptions[(this.selectIndex-1)].name, this.popupInput])
    }
  }
</script>
